1. Field of the Invention
The method of the present invention generally relates to a method for changing the resolution of compressed image data and more particularly a method for expanding or contracting an image which has been converted into a dot pattern by scanning and then compressed by an algorithm.
2. Description of the Prior Art
Using current digital technology, it is common practice to scan an image, which is to be either stored or displayed on a computer, to first convert the image to a dot pattern of dark and light dots by scanning the image such that the image can be displayed on a monochrome cathode ray tube type display. Often times, in order to save memory within the system in which the image is to be stored, the dot pattern data is compressed by using an algorithm such as the algorithm specified in CCITT recommendations for Group 3 and Group 4 facsimile equipment, entitled non-length encoded data compression. This algorithm is intended for black and white images of text and diagrams. This compression algorithm is generally worked by scanning along a horizontal scan line of the dot patern and counting the number of consecutive dark dots and storing that as a coded information and then once a light dot is found counting the number of light dots and storing that as coded information and so on until the complete horizontal line has been scanned before moving on to the next horizontal scan line. By coding the dot pattern in this manner, the amount of memory in the data processing system necessary to hold the image can be greatly reduced over storing the image with a bit in one state indicating a light dot and a bit in the other state indicating a dark dot. The time to transmit the image is also reduced proportionately. For example, if an image is scanned into a dot pattern consisting of 400 vertical columns and 400 horizontal rows such that there is a dot at the intersection of each vertical column and horizontal row producing a total of 160,000 dots or pixels. An image that is coded by a binary ONE representing a dark spot and a binary ZERO representing a light spot on the image would require a minimum of 160,000 bits of memory to be stored, whereas that same image when encoded could be stored in significantly fewer bits of memory when using a compression algorithm such as the CCITT algorithm.
When working with images in computer systems, it is often desirable to be able to change the resolution of the image by either expanding or contracting the resolution. In doing this resolution change, which is also known as zooming, when expanding the image, the dots within the original image are expanded into a greater number of dots in the expanded image and when contracting the image, the number of dots in the original image are reduced into a smaller number of dots in the contracted image. If the original image data is stored as compressed image data, this resolution change is normally accomplished by first changing the compressed data image into a dot pattern image data and then the dot pattern image data is manipulated to perform either the required expansion or contraction. Unfortunately, when working in this manner a large amount of memory may be required in order to take the compressed image data an expand it into the dot pattern image data. Besides requiring a large amount of data to hold the dot pattern image data in the non-compressed format, the necessity to decompress the image into the dot pattern image data also slows down the resolution change process because a large number of memory reads and writes must be performed when decompressing the compressed image data.
Performing the resolution change on the dot pattern image data has a second disadvantage. Small blocks of similar light or dark dots may be randomly reduced or expanded depending upon their exact position within the image. For example, a single dot representing a section of a narrow line may be eliminated even by slight image reductions such as 20% and has a 50% chance of being eliminated in a 2-to-1 reduction. Further, a double dot for a line may be reduced to a single dot on a random basis for reductions of less than 2-to-1 and may be eliminated altogether for reductions of greater than 2-to-1. In the case of image expansion where dots are added to the image to expand the image, the results are less than catastrophic, but a slanted line within the image, such as found in sides of a letter A, which may be two dots wide in the original image, may be randomly expanded along its length when expansion is done by processing the dot pattern image data.
Therefore, what is needed is a method for performing resolution change on compressed image data which does not require large amounts of memory, or large amounts of time, and which results in more or less uniform expansions and contractions of the image.